<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>短视频详情页</title>
        <link rel="stylesheet" href="lib/css/mobile-reset.css">
        <link rel="stylesheet" href="lib/css/video.css">
        <link rel="stylesheet" href="css/detail.css">

    </head>
    <body>
        <div class="detail">
            <!--短视频详情video部分开始-->
            <div class="oam-detailV">

            </div>
            <!--短视频详情video部分结束-->

            <!--精彩导视部分开始-->
            <section class="oam-recommend" style=display:none>
                <h3 class="oam-rec-title">
                    精彩导视
                </h3>
                <ul class="oam-rec-list">
                </ul>
            </section>
            <!--精彩导视部分结束-->

        </div>
    </body>

    <script src="lib/js/jquery-1.12.3.min.js"></script>
    <script src="lib/js/jweixin-1.2.0.js"></script>
    <script src="lib/js/jquery.cookie.js"></script>
    <script src="lib/js/md5.js"></script>
    <script src="lib/js/video.js"></script>
    <script src="lib/js/base.js"></script>
    <script src="js/detail.js"></script>
    
    <script>
        
        //微信分享-彩云之端示例
        $(function () {
            var wx_appId;
            var wx_timestamp;
            var wx_nonceStr;
            var wx_signature;
            var url = website + 'getWxJsConfig'; //获取微信配置接口
            jQuery.ajax({
                url: url,
                data: {url: window.location.href},
                type: "GET",
                async: false,
                beforeSend: function () {
                },
                success: function (returnJson) {
                    console.log(returnJson);
                    var data = JSON.parse(returnJson);
                    if (data.statusCode === 0) { //获取成功- 更新微信config
                        wx_appId = data.data.appId;
                        wx_timestamp = data.data.timestamp;
                        wx_nonceStr = data.data.nonceStr;
                        wx_signature = data.data.signature;
                    } else {

                    }
                },
                error: function () {

                }
            });

            /*
             * 微信config
             */
            wx.config({
                debug: false,
                appId: wx_appId,
                timestamp: wx_timestamp,
                nonceStr: wx_nonceStr,
                signature: wx_signature,
                jsApiList: [
                    'checkJsApi',
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                    'onMenuShareQQ',
                    'onMenuShareWeibo',
                    'onMenuShareQZone',
                ]
            });

            document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
                // 发送给好友
                WeixinJSBridge.on('menu:share:appmessage', function (argv) {
                    WeixinJSBridge.invoke('sendAppMessage', {
                        "img_url": window.shareData.iconUrl,
                        "img_width": "401",
                        "img_height": "275",
                        "link": window.shareData.url,   //detail.js 中声明
                        "desc": window.shareData.description,   //detail.js 中声明
                        "title": window.shareData.title //detail.js 中声明
                    }, function (res) {
                        _report('send_msg', res.err_msg);
                    });
                });
                // 分享到朋友圈
                WeixinJSBridge.on('menu:share:timeline', function (argv) {
                    WeixinJSBridge.invoke('shareTimeline', {
                        "img_url": window.shareData.iconUrl,
                        "img_width": "401",
                        "img_height": "275",
                        "link": window.shareData.url,   //detail.js 中声明
                        "desc": window.shareData.description,   //detail.js 中声明
                        "title": window.shareData.title //detail.js 中声明
                    }, function (res) {
                        _report('send_msg', res.err_msg);
                    });
                });
                // 分享到微博
                WeixinJSBridge.on('menu:share:weibo', function (argv) {
                    WeixinJSBridge.invoke('shareWeibo', {
                        "img_url": window.shareData.iconUrl,
                        "img_width": "401",
                        "img_height": "275",
                        "link": window.shareData.url,   //detail.js 中声明
                        "desc": window.shareData.description,   //detail.js 中声明
                        "title": window.shareData.title //detail.js 中声明
                    }, function (res) {
                        _report('send_msg', res.err_msg);
                    });
                });
                // 分享到QQ
                WeixinJSBridge.on('menu:share:qq', function (argv) {
                    WeixinJSBridge.invoke('shareQQ', {
                        "img_url": window.shareData.iconUrl,
                        "img_width": "401",
                        "img_height": "275",
                        "link": window.shareData.url,   //detail.js 中声明
                        "desc": window.shareData.description,   //detail.js 中声明
                        "title": window.shareData.title //detail.js 中声明
                    }, function (res) {
                        _report('send_msg', res.err_msg);
                    });
                });
            }, false)
        });
    </script>
</html>